package com.lzh.financial.service.impl;

import cn.hutool.core.util.IdcardUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import com.lzh.financial.bean.PUserBean;
import com.lzh.financial.bean.PUserInfoBean;
import com.lzh.financial.dao.IUserMapper;
import com.lzh.financial.dto.KeyValueDTO;
import com.lzh.financial.dto.UserDTO;
import com.lzh.financial.params.PeopleParam;
import com.lzh.financial.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author reborn0530
 * 用户service实现类
 */
@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<IUserMapper, PUserBean> implements IUserService {



    @Override
    public UserDTO selectbyUserName(String userName) {
        return getBaseMapper().selectbyUserName(userName);
    }

    @Override
    public UserDTO selectbyMobile(String mobile) {

        return getBaseMapper().selectbyMobile(mobile);
    }

    @Override
    public UserDTO selectbyUserId(Integer userId) {
        return getBaseMapper().selectbyUserId(userId);
    }

    @Override
    public UserDTO selectbyCode(String code) {
        return IdcardUtil.isValidCard(code)?getBaseMapper().selectbyCode(code):null;
    }
    @Override
    public List<UserDTO> selectPeople(PeopleParam peopleParam) {
        return getBaseMapper().selectPeople(peopleParam);
    }

    @Override
    public List<KeyValueDTO> selectbyGroup(Integer id) {
        return getBaseMapper().selectbyGroup(id);
    }


}
